function wfh = plotEEGWeb(y, samplingRate, spindles, plotTitles, titleText, plotWidth, plotHeight, filtered)

global PLOT_FOR_WEB PLOT_WIDTH PLOT_HEIGHT

PLOT_FOR_WEB = true;
PLOT_WIDTH = plotWidth;
PLOT_HEIGHT = plotHeight;
                 
if(nargin <= 7)	
	filtered(1:size(y, 2)) = false;
end

x = getXAxisData(samplingRate);

% Subsampling...so that the data granularity makes sense for a 1024px wide
% screen.
MIN_SAMPLING_FREQ = 256;
% Subsampling factor
M = samplingRate/MIN_SAMPLING_FREQ;

x = x(1 : 4 * M : length(x));

counter = 0;
newY = [];
for k = y
    counter = counter + 1;
    k = k(1 : 4 * M : length(k));
    newY = [newY k];
end

fh = createEEGFigure(x, newY, spindles, plotTitles, titleText, filtered);

%white background
set(fh, 'Color', [1 1 1]);

%figure(fh);
wfh = webfigure(fh);
delete(fh);

